package cn.java79.quiz.controller;

import cn.java79.quiz.util.LogUtil;
import org.springframework.web.bind.annotation.ControllerAdvice;
import org.springframework.web.bind.annotation.ExceptionHandler;

import java.sql.SQLException;

/**
 * @author oldliu
 * @since 1.0
 */
//所有的controller通知
@ControllerAdvice
public class MyExceptionHandler {
    @ExceptionHandler(Exception.class)
    public String except(Exception e){
        LogUtil.handlerException(e);
        return "error";
    }
}
